Spread for ASP.NET 7.0 Product Documentation
GetValidConditionalFormat(Int32,Int32,IPrePaintConditionalFormattingRule[],IPrePaintTextConditionalFormattingRule[]) Method
See Also  Example Support Options
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > SheetView Class : GetValidConditionalFormat(Int32,Int32,IPrePaintConditionalFormattingRule[],IPrePaintTextConditionalFormattingRule[]) Method


row
Row index
column
Column index
prePaintCFRules
The pre-paint conditional format rules
prePaintTextCFRules
The pre-paint text conditional format rules

Glossary Item Box

Gets the valid conditional format.

Syntax

Visual Basic (Declaration) 
Public Sub GetValidConditionalFormat( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByRef prePaintCFRules As IPrePaintConditionalFormattingRule(), _
   ByRef prePaintTextCFRules As IPrePaintTextConditionalFormattingRule() _
) 
Visual Basic (Usage)Copy Code
Dim instance As SheetView
Dim row As Integer
Dim column As Integer
Dim prePaintCFRules As IPrePaintConditionalFormattingRule()
Dim prePaintTextCFRules As IPrePaintTextConditionalFormattingRule()
 
instance.GetValidConditionalFormat(row, column, prePaintCFRules, prePaintTextCFRules)
C# 
public void GetValidConditionalFormat( 
   int row,
   int column,
   out IPrePaintConditionalFormattingRule[] prePaintCFRules,
   out IPrePaintTextConditionalFormattingRule[] prePaintTextCFRules
)

Parameters

row
Row index
column
Column index
prePaintCFRules
The pre-paint conditional format rules
prePaintTextCFRules
The pre-paint text conditional format rules

Example

This example uses the GetValidConditionalFormat method.
C#Copy Code
FarPoint.Web.Spread.UnaryComparisonConditionalFormattingRule unary = new FarPoint.Web.Spread.UnaryComparisonConditionalFormattingRule(FarPoint.Web.Spread.UnaryComparisonOperator.EqualTo, 3);
unary.Operator = FarPoint.Web.Spread.UnaryComparisonOperator.EqualTo;
//unary.Value = 3;
unary.BackColor = Color.Red;
unary.FontStyle = new FarPoint.Web.Spread.SpreadFontStyle(FarPoint.Web.Spread.UnderlineFontStyle.None);
unary.FontStyle.RegularBoldItalic = FarPoint.Web.Spread.RegularBoldItalicFontStyle.Bold;
FarPoint.Web.Spread.Model.CellRange range = new FarPoint.Web.Spread.Model.CellRange(0, 0, 3, 3);
FarPoint.Web.Spread.ConditionalFormatting cfequal = new FarPoint.Web.Spread.ConditionalFormatting(range);
cfequal.Add(unary);

FpSpread1.ActiveSheetView.ConditionalFormatting.Add(cfequal);
//FpSpread1.ActiveSheetView.SetConditionalFormatting(1, 1, unary);
//FpSpread1.ActiveSheetView.SetConditionalFormatting(0, 0, unary);

FarPoint.Web.Spread.IPrePaintConditionalFormattingRule[] prePaintRule;
FarPoint.Web.Spread.IPrePaintTextConditionalFormattingRule[] prePaintTextRule;
FpSpread1.ActiveSheetView.GetValidConditionalFormat(0, 0, out prePaintRule, out prePaintTextRule);

FarPoint.Web.Spread.PrePaintResult pp = prePaintRule[0].Execute(0, 0, FpSpread1.ActiveSheetView.Cells[0, 0].Value);
FarPoint.Web.Spread.StyleInfo source = new FarPoint.Web.Spread.StyleInfo();
FpSpread1.ActiveSheetView.Cells[1, 1].Value = 3;
FarPoint.Web.Spread.PrePaintResult pp1 = prePaintRule[0].Execute(1, 1, FpSpread1.ActiveSheetView.Cells[1, 1].Value);
VB.NETCopy Code
Dim unary As New FarPoint.Web.Spread.UnaryComparisonConditionalFormattingRule(FarPoint.Web.Spread.UnaryComparisonOperator.EqualTo, 3)
unary.[Operator] = FarPoint.Web.Spread.UnaryComparisonOperator.EqualTo
'unary.Value = 3;
unary.BackColor = Drawing.Color.Red
unary.FontStyle = New FarPoint.Web.Spread.SpreadFontStyle(FarPoint.Web.Spread.UnderlineFontStyle.None)
unary.FontStyle.RegularBoldItalic = FarPoint.Web.Spread.RegularBoldItalicFontStyle.Bold
Dim range As New FarPoint.Web.Spread.Model.CellRange(0, 0, 3, 3)
Dim cfequal As New FarPoint.Web.Spread.ConditionalFormatting(range)
cfequal.Add(unary)

FpSpread1.ActiveSheetView.ConditionalFormatting.Add(cfequal)
'FpSpread1.ActiveSheetView.SetConditionalFormatting(1, 1, unary);
'FpSpread1.ActiveSheetView.SetConditionalFormatting(0, 0, unary);

Dim prePaintRule As FarPoint.Web.Spread.IPrePaintConditionalFormattingRule()
Dim prePaintTextRule As FarPoint.Web.Spread.IPrePaintTextConditionalFormattingRule()
FpSpread1.ActiveSheetView.GetValidConditionalFormat(0, 0, prePaintRule, prePaintTextRule)

Dim pp As FarPoint.Web.Spread.PrePaintResult = prePaintRule(0).Execute(0, 0, FpSpread1.ActiveSheetView.Cells(0, 0).Value)
Dim source As New FarPoint.Web.Spread.StyleInfo()
FpSpread1.ActiveSheetView.Cells(1, 1).Value = 3
Dim pp1 As FarPoint.Web.Spread.PrePaintResult = prePaintRule(0).Execute(1, 1, FpSpread1.ActiveSheetView.Cells(1, 1).Value)

Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.